﻿<%
Function IsObjInstalled(strClassString)
On Error Resume Next
IsObjInstalled = False
Err = 0
Dim xTestObj
Set xTestObj = Server.CreateObject(strClassString)
If 0 = Err Then IsObjInstalled = True
Set xTestObj = Nothing
Err = 0
End Function
sub ServerInfomation
	Dim theInstalledObjects(17)
    theInstalledObjects(0) = "MSWC.AdRotator"
    theInstalledObjects(1) = "MSWC.BrowserType"
    theInstalledObjects(2) = "MSWC.NextLink"
    theInstalledObjects(3) = "MSWC.Tools"
    theInstalledObjects(4) = "MSWC.Status"
    theInstalledObjects(5) = "MSWC.Counters"
    theInstalledObjects(6) = "IISSample.ContentRotator"
    theInstalledObjects(7) = "IISSample.PageCounter"
    theInstalledObjects(8) = "MSWC.PermissionChecker"
    theInstalledObjects(9) = "Scripting.FileSystemObject"
    theInstalledObjects(10) = "adodb.connection"
    
    theInstalledObjects(11) = "SoftArtisans.FileUp"
    theInstalledObjects(12) = "SoftArtisans.FileManager"
    theInstalledObjects(13) = "JMail.SMTPMail"
    theInstalledObjects(14) = "CDONTS.NewMail"
    theInstalledObjects(15) = "Persits.MailSender"
    theInstalledObjects(16) = "LyfUpload.UploadFile"
    theInstalledObjects(17) = "Persits.Upload.1"
%></p><table width="1000px" border="0" cellspacing="1" align="center" class="font" bgcolor="#000000"><form name="form1" method="post" action="#"><tr><td bgcolor="#F7F3F7" height="25"><p align="center">－－组件支持情况检测－－<br>在下面的输入框中输入你要检测的组件的Prog Id或Class Id。</td></tr><tr><td bgcolor="#FFFFFF"><div align="center"><input class=textfield type=text value="" name="classname" size=40><INPUT type=submit value="确定" id=submit1 name=submit1 class="botton"><INPUT type=reset value="重填" id=reset1 name=reset1 class="botton"></div></td></tr></form></table><br><%
    Dim strClass
    strClass = Trim(Request.Form("classname"))
    If "" <> strClass then%><table width="90%" border="0" cellspacing="1" align="center" class="font" bgcolor="#000000"><tr bgcolor="#FFFFFF"><td class="docbutton"><%Response.Write "您指定的组件的检查结果："
      If Not IsObjInstalled(strClass) then 
        Response.Write "<br><font color=red>很遗憾，该服务器不支持" & strclass & "组件！</font>"
      Else
        Response.Write "<br><font color=green>恭喜！该服务器支持" & strclass & "组件。</font>"
      End If
      Response.Write "<br></td></tr></table><br>"
      end if
%><table width="90%" border="0" cellspacing="1" align="center" class="font" bgcolor="#000000"><tr bgcolor="#FFFFFF"><td height="25" width="50%">本程序绝对路径:</td><td bgcolor="#F7F3F7"><%=Server.MapPath("../default.asp")%></td></tr><tr><td height="25" width="50%" bgcolor="#FFFFFF">
				检取ISAPIDLL的metabase路径</td><td bgcolor="#F7F3F7"><%=request.ServerVariables("APPL_MD_PATH")%></td></tr><tr><td height="25" width="50%" bgcolor="#FFFFFF">显示站点物理路径</td><td bgcolor="#F7F3F7"><%=request.ServerVariables("APPL_PHYSICAL_PATH")%></td></tr><tr><td height="25" width="50%" bgcolor="#FFFFFF">路径信息</td><td bgcolor="#F7F3F7"><%=request.ServerVariables("PATH_INFO")%></td></tr><tr><td height="25" width="50%" bgcolor="#FFFFFF">显示请求机器IP地址</td><td bgcolor="#F7F3F7"><%=request.ServerVariables("REMOTE_ADDR")%></td></tr><tr><td height="25" width="50%" bgcolor="#FFFFFF">服务器IP地址</td><td bgcolor="#F7F3F7"><%=Request.ServerVariables("LOCAL_ADDR")%></td></tr><tr><td height="25" width="50%" bgcolor="#FFFFFF">显示执行SCRIPT的虚拟路径</td><td bgcolor="#F7F3F7"><%=request.ServerVariables("SCRIPT_NAME")%></td></tr><tr><td height="25" width="50%" bgcolor="#FFFFFF">
				返回服务器的主机名，DNS别名，或IP地址</td><td bgcolor="#F7F3F7"><%=request.ServerVariables("SERVER_NAME")%></td></tr><tr><td height="25" width="50%" bgcolor="#FFFFFF">返回服务器处理请求的端口</td><td bgcolor="#F7F3F7"><%=request.ServerVariables("SERVER_PORT")%></td></tr><tr><td height="25" width="50%" bgcolor="#FFFFFF">协议的名称和版本</td><td bgcolor="#F7F3F7"><%=request.ServerVariables("SERVER_PROTOCOL")%></td></tr><tr><td height="25" width="50%" bgcolor="#FFFFFF">服务器的名称和版本</td><td bgcolor="#F7F3F7"><%=request.ServerVariables("SERVER_SOFTWARE")%></td></tr><tr><td height="25" width="50%" bgcolor="#FFFFFF">服务器操作系统</td><td bgcolor="#F7F3F7"><%=Request.ServerVariables("OS")%></td></tr><tr><td height="25" width="50%" bgcolor="#FFFFFF">脚本超时时间</td><td bgcolor="#F7F3F7"><%=Server.ScriptTimeout%>秒</td></tr><tr><td height="25" width="50%" bgcolor="#FFFFFF">服务器CPU数量</td><td bgcolor="#F7F3F7"><%=Request.ServerVariables("NUMBER_OF_PROCESSORS")%>&nbsp; 
				个</td></tr><tr><td height="25" width="50%" bgcolor="#FFFFFF">服务器解译引擎</td><td bgcolor="#F7F3F7"><%=ScriptEngine & "/"& ScriptEngineMajorVersion &"."&ScriptEngineMinorVersion&"."& ScriptEngineBuildVersion %></td></tr><%
    dim i
    For i=0 to 10
  %><TR bgcolor="#FFFFFF"><TD height="25" width="50%"><%=theInstalledObjects(i)%><%select case i
		case 9
		Response.Write "(FSO 文本文件读写)"
		case 10
		Response.Write "(ACCESS 数据库)"
	  end select
	  %></td><td bgcolor="#F7F3F7"><div align="center"><%If Not IsObjInstalled(theInstalledObjects(i)) Then 
        Response.Write "<font color=red><b>×</b></font>"
      Else
        Response.Write "<b>√</b>"
      End If%></div></td></TR><%Next%><%For i=11 to UBound(theInstalledObjects)%><TR bgcolor="#FFFFFF"><TD height="25" width="50%"><%=theInstalledObjects(i)%><%select case i
		case 11
		Response.Write "(SA-FileUp 文件上传)"
		case 12
		Response.Write "(SA-FM 文件管理)"
		case 13
		Response.Write "(JMail 邮件发送)"
		case 14
		Response.Write "(CDONTS 邮件发送 SMTP Service)"
		case 15
		Response.Write "(ASPEmail 邮件发送)"
		case 16
		Response.Write "(LyfUpload 文件上传)"
		case 17
		Response.Write "(ASPUpload 文件上传)"
      end select%></td><td bgcolor="#F7F3F7"><div align="center"><%If Not IsObjInstalled(theInstalledObjects(i)) Then 
        Response.Write "<font color=red><b>×</b></font>"
      Else
        Response.Write "<b>√</b>"
      End If%></div></td></TR><%Next%><% For Each name In Request.ServerVariables %><tr bgcolor="#FFFFFF"><td height="25" width="50%"><b><%=name%></b></td><td bgcolor="#F7F3F7"><%=Request.ServerVariables(name)%></td></tr><%Next%></table><%end sub%>